import static org.junit.Assert.*;

import org.junit.Test;


public class MarsTester {

	MarsCalc mars1 = new MarsCalc();
	MarsCalc mars2 = new MarsCalc();
	
	@Test
	public void firstNTest(){
		mars1.location(0, 0, 2000, 1, 6);
		assertEquals("N on Jan 6, 2000. Long = 0 Lat = 0", mars1.testN(), 4.50074, .6);
	}

	@Test
	public void firstPBSTest(){
		mars1.location(0, 0, 2000, 1, 6);
		assertEquals("PBS on Jan 6, 2000.", mars1.testPBS(), .00142, .001);
	}
	
	@Test
	public void firstFMSTest(){
		mars1.location(0, 0, 2000, 1, 6);
		assertEquals("FMS test on mars1", mars1.testFMS(), 272.74486, .1);
	}
	
	@Test
	public void firstJDTest(){
		mars1.location(0, 0, 2000, 1, 6);
		assertEquals("JD test on mars1", mars1.testJD(), 2451549.5, 1);
	}
	
	@Test
	public void firstOffsetTest(){
		mars1.location(0, 0, 2000, 1, 6);
		assertEquals("OffsetTest on mars1", mars1.testOffset(), -5.18764, .1);
	}
	
	@Test
	public void firstMTest(){
		mars1.location(0, 0, 2000, 1, 6);
		assertEquals("M test on mars1", mars1.testM(), 21.74548, .2);
	}
	
	@Test
	public void firstVminNTest(){
		mars1.location(0, 0, 2000, 1, 6);
		assertEquals("VminM test on mars1", mars1.testVminM(), 4.44191, .1);
	}
	
	@Test
	public void firstLsTest(){
		mars1.location(0, 0, 2000, 1, 6);
		assertEquals("Ls test on mars1", mars1.testLs(), 277.18677, .1);
	}
	
	@Test
	public void secondNTest(){
		mars2.location(-175.298, 14.64, 2004, 1, 4);
		assertEquals("N on Jan 4, 2004. Long = 185W Lat = 14.64", mars2.testN(), 1463.07471, .6);
	}
	
	@Test
	public void secondPBSTest(){
		mars2.location(-175.298, 14.64, 2004, 1, 4);
		assertEquals("PBS test mars2", mars2.testPBS(), .01614, .001);
	}
	
	@Test
	public void secondFMSTest(){
		mars2.location(-175.298, 14.64, 2004, 1, 4);
		assertEquals("FMS test mars2", mars2.testFMS(), 317.09363, .5);
	}
	
	@Test
	public void secondJDTest(){
		mars2.location(-175.298, 14.64, 2004, 1, 4);
		assertEquals("JD test mars2", mars2.testJD(), 2453008.07471, 1);
	}
	
	@Test
	public void secondOffsetTest(){
		mars2.location(-175.298, 14.64, 2004, 1, 4);
		assertEquals("offset test mars2", mars2.testOffset(), -12.77557, .1);
	}
	
	@Test
	public void secondMTest(){
		mars2.location(-175.298, 14.64, 2004, 1, 4);
		assertEquals("M test on mars2", mars2.testM(), 66.06851, .5);
	}
	
	@Test
	public void secondVminMTest(){
		mars2.location(-175.298, 14.64, 2004, 1, 4);
		assertEquals("VminM test on mars2", mars2.testVminM(), 10.22959, .1);
	}
	
	@Test
	public void secondLsTest(){
		mars2.location(-175.298, 14.64, 2004, 1, 4);
		assertEquals("Ls test on mars2", mars2.testLs(), 327.32322, .5);
	}
}
